﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12继承练习
{
    class Program
    {
        static void Main(string[] args)
        {
            //Son son = new Son("zhangsan",100,"ab");
            
            //里氏替换原则，要的是一个父类类型的对象，给的是一个子类类型对象
            Father ff = new Son("lisi", 100, "AB");
            M1(ff);
        }

        private static void M1(Father ff)
        {
            Console.WriteLine(ff.LastName);
        }
    }

    class Father
    {
        public Father(string xingming,double caichan,string xuexing)
        {
            this.LastName = xingming;
            this.Property = caichan;
            this.BloodType = xuexing;
        }
        public string LastName { get; set; }
        public double Property { get; set; }
        public string  BloodType { get; set; }

    }

    class Son:Father
    {
        public Son(string xm,double cc,string xx):base(xm,cc,xx)
        {

        }
        public void PlayGame()
        {
            Console.WriteLine("LOL ing........");
        }
    }
    class Daughter:Father
    {
        public Daughter(string lastname,double property,string bloodtype):base(lastname,property,bloodtype)
        {

        }
        public void Dance()
        {
            Console.WriteLine("dancing.....");
        }
    }
}
